Simpler way to implement map function in OCaml